<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>资金统计</title>
    <script src="../../js/jquery-3.3.1.min.js" charset="utf-8"></script>
    <script src="../../js/cookie/jquery.cookie.js" charset="utf-8"></script>
    <script src="../../layui-v2.2.5/layui/layui.js" charset="utf-8"></script>
    <script src="/js/layui/form_verify.js"></script>
    <link rel="stylesheet" href="../../layui-v2.2.5/layui/css/layui.css" media="all">
    <style>
        table{
            border-collapse: collapse;
        }
        td{width:180px;padding:5px;border:1px solid black;}
        tr{display:block;}
        .shuaxin{
            display: flex;
            align-items: center;
        }
        .shuaxin>div input{
            height: 27px;
        }
        .shuaxin>div{
            margin-right: 20px;
        }
        .shuaxin select{
            width: 180px;
            height: 27px;
        }
    </style>
</head>
<body>


<div class="shuaxin">
    <div>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:0px;margin-right: 100px"  href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">ဂ</i>
        </a>
    </div>
     <div>开始时间：<input type="text" id="startDate" value="${startDate}"></div>
     <div>结束时间：<input type="text" id="endDate" value="${endDate}"></div>
    <div>
         活动：
        <select name="activityId" lay-verify="" lay-search id="activityId">
            <option value=""></option>
            <c:forEach items="${activityList}" var="activity">
                <option value="${activity.id}" <c:if test="${activity.id eq activityId}">selected="selected"</c:if>>
                        ${activity.name}</option>
            </c:forEach>

    </select>

    </div>
    <div><button class="layui-btn" onclick="search();">搜索</button></div>
        <script>

            function search() {
                window.location.href="/finance/financeStatistics?startDate="+$("#startDate").val()
                        +"&endDate="+$("#endDate").val()+"&activityId="+$("#activityId").val();
            }

        </script>
</div>
</br>
<div style="margin-top: 1%">
    <table>
        <tr>
            <td><span>订单数量</span></td> <td><span>${resultMap.orderStatistics.number}</span></td>
            <td><span>收款金额</span></td>
            <td>
                <span>
                <fmt:formatNumber type="number" value="${resultMap.orderStatistics.money}" pattern="0.00"/>
                </span>
            </td>
            <td><span>分销返利</span></td>
            <td>
                <span>
            <fmt:formatNumber type="number" value="${resultMap.rebateStatistics.money}" pattern="0.00"/>

                </span>
            </td>
            <td><span>退款金额</span></td> <td><span>
            <fmt:formatNumber type="number" value="${resultMap.refundStatistics.money}" pattern="0.00"/>
            </span></td>
        </tr>
        <tr>
            <td><span>推广返利</span></td> <td><span>
            <fmt:formatNumber type="number" value="${resultMap.shareStatistics.money}" pattern="0.00"/>
            </span></td>
            <td><span>手续费</span></td> <td><span>${resultMap.commission}</span></td>
            <td><span>提现金额</span></td> <td><span>
            <fmt:formatNumber type="number" value="${resultMap.withdrawStatistics.money}" pattern="0.00"/>
            </span></td>
            <td><span>平台剩余金额</span></td> <td><span>${resultMap.balance}</span></td>
        </tr>

    </table>
</div>
<script>

    layui.use(['layer','laydate'], function(){
        var layer = layui.layer;
        var laydate = layui.laydate;

        //开始时间
        laydate.render({
            elem: '#startDate' //指定元素
        });
        //结束时间
        laydate.render({
            elem: '#endDate' //指定元素
        });
    });


</script>

</body>
</html>
